package com.greatwall.hip.cms.controller;

import com.greatwall.hip.cms.model.Req;
import com.greatwall.hip.cms.model.Result;
import com.greatwall.hip.cms.service.EpidemicMonitorService;
import com.greatwall.hip.cms.vo.EpidemicMonitorVO;
import com.greatwall.hip.cms.vo.MonitorDiseaseAndPacsBarVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * (LyDiseaseTag)表控制层
 *
 * @author makejava
 * @since 2021-07-06 19:42:51
 */
@RestController
@Api(tags = "疫情监测模块", value = "重大疫情智能监测预警")
@RequestMapping("epidemicMonitor")
public class EpidemicMonitorController {

    /**
     * 服务对象
     */
    @Resource
    private EpidemicMonitorService epidemicMonitorService;

    /**
     * 通过主键查询单条数据
     *
     * @return result
     */
    @ApiOperation("重大疫情智能监测预警")
    @PostMapping("/lastMonMonitor")
    public Result<EpidemicMonitorVO> lastMonMonitor(@RequestBody Req req) {
        return epidemicMonitorService.lastMonMonitor(req);
    }

    /**
     * 疾病和影像饼图数据
     *
     * @param request 日期
     * @return result
     */
    @ApiOperation("疾病和影像饼图数据")
    @PostMapping("/diseaseAndPacsBar")
    public Result<MonitorDiseaseAndPacsBarVO> diseaseAndPacsBar(@RequestBody Req request) {
        return Result.success(epidemicMonitorService.diseaseAndPacsBar(request));
    }

}